class Book {
  int? id;
  final String title;
  final String author;
  final String path;

  Book({this.id, required this.title, required this.author, required this.path});


  // 本地书籍应该带地址！
  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'title': title,
      'author': author,
      'path': path,
    };
  }

  factory Book.fromMap(Map<String, dynamic> map) {
    return Book(
      id: map['id'],
      title: map['title'],
      author: map['author'],
      path: map['path'],
    );
  }

  @override
  String toString() => 'Book(id:$id, title:$title, author:$author, path:$path)';
}

